<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <%@include file="/common/common.jsp" %>
    <link rel="stylesheet" href="${basePath}/css/layerPage.css${VERSION}"/>
</head>
<body>
<div class="right-container">
    <div class="row">
        <div class="col-xs-12">

            <table id="grid-table"></table>

            <div id="grid-pager"></div>

        </div>
        <input type="hidden" id="id" name = "id" value="${noticeId}"/>
    </div>
</div>
<!-- page specific plugin scripts -->
<script src="${basePath}/plugins/jqGrid/jquery.jqGrid.min.js${VERSION}"></script>
<script src="${basePath}/plugins/jqGrid/grid.locale-cn.js${VERSION}"></script>
<script>
    jQuery(function ($) {
        var id = $.trim($('#id').val());
        CommonUtils.grid({
            url: "${basePath}/notice/readByPage?id="+id,
            colNames: ['序号','','姓名', '是否已读'],
            colModel: [
                {
                    name: 'id', index: 'id', key: true, width: 30, sorttype: "int",
                    formatter: CommonUtils.formateID
                },
                {name: 'mesId', index: 'mesId', hidden:true},
                {
                    name: 'userName',
                    index: 'userName',
                    width: 130
                },
                {
                    name: 'isRead',
                    index: 'isRead',
                    width: 50,
                    formatter:showType
                }
            ]
        });
        function showType(value, row, index){
          if(value == "1"){
                return "已读"
            }else {
                return "未读"
            }
        }
    });
</script>
</body>
</html>